package com.dcy.common.model;

import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.util.List;

/**
 * @Author：dcy
 * @Description: 分页类
 * @Date: 2020/11/26 8:33
 */
@ToString
@Getter
@Setter
public class PageModel {

    @ApiModelProperty(value = "当前页面", notes = "默认1", example = "1")
    private long current;

    @ApiModelProperty(value = "每页显示条数", notes = "默认30", example = "30")
    private long size;

    private List<Order> orders;

    @ToString
    @Getter
    @Setter
    public static class Order {

        @ApiModelProperty(value = "排序字段", notes = "用于model字段")
        private String column;

        @ApiModelProperty(value = "是否正序排列，默认 true", notes = "true 或者 false", allowableValues = "true,false")
        private Boolean asc = Boolean.TRUE;

    }

}
